perf(ds4): reuse F16 KV in fused verification - #632
Merged
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
|
looks good to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an opt-in
--ds4-fused-verify-f16-kvpath for single-device HIP DeepSeek V4 verification.The existing explicit batched verifier converts the complete persistent F16 MLA cache to F32 on every speculative step. This path feeds the same raw and compressed rows directly from the F16 cache into the established explicit attention topology. It keeps F32 key-side accumulation through 512 attention rows to protect the short-context baseline, then avoids the full-cache conversion at longer contexts.
The attended row set, masks, and explicit attention operation order are unchanged. The option remains off by default and is rejected by the feature gate outside a monolithic HIP DeepSeek V4 backend. It can still change generated tokens because the verifier inputs are F16.
Published qualification patches:
lucebox-ds4-fused-explicit-f16-kv.patchlucebox-ds4-explicit-f16-f32-attention.patchMatched benchmark
Ryzen AI Max+ 395 / Radeon 8060S, ROCm 7.1.1, 100/100/100 W package limits, fixed-high GPU policy, ROCmFPX target, Q4RMFP4 DSpark draft, all six experts, q=4 fused verification, Q4_0 K/V. Each comparison used the same prompt and power policy.
The long-context decode gain is 37.2%; prefill is unchanged within run variance. A production composition including this path and the same 512-row F32 cutoff later passed 122,879-token 5/5 retrieval, 1.00 acceptance, and the 30/30 quality gate. The deployment-specific adaptive-prefill and graph-cache limits from that composition are intentionally not part of this PR.
Reproduction setup and benchmark definitions: https://github.com/pepuscz/strix-halo-deepseek-v4-flash
Validation
git diff --checkMoeHybridStorageFixture::fractional_route_quota_rounds_over_the_batchexpectation